package com.itheima.demo01;

import java.util.Arrays;

public class Cai {

    public static void main(String[] args) {

        String s = "91 46 28 37 50";

        String[] s1 = s.split(" ");

        int[] arr = new int[s1.length];

        for (int i = 0; i < s1.length; i++) {

            String s2 = s1[i];

            int i1 = Integer.parseInt(s2);

            arr[i] = i1;
        }

        Arrays.sort(arr);

        StringBuilder s3 = new StringBuilder();

        for (int i = 0; i < arr.length; i++) {

            if(i==arr.length-1){
                s3.append(arr[i]);
            }else {
                s3.append(arr[i]).append(" ");
            }
        }

        String s2 = s3.toString();

        System.out.println(s2);
    }
}
